package fr.cdj.thebox.client.menu.ui;

import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.inject.Inject;
import com.google.inject.Provider;

import fr.cdj.thebox.client.resources.TheboxBundle;
import fr.cdj.thebox.client.utils.Icon;

public class MenuItem extends SimplePanel implements HasClickHandlers {
	
	private Icon button;
	
	@Inject
	public MenuItem(TheboxBundle resources, Provider<Icon> iconProvider) {
		this.setStyleName(resources.getStyle().menuItem());
		button = iconProvider.get();
		
		this.add(button);
	}

	public void addButtonStyleName(String style) {
		button.addStyleName(style);
	}
	
	@Override
	public HandlerRegistration addClickHandler(ClickHandler handler) {
		return button.addClickHandler(handler);
	}

}
